<!DOCTYPE html>
<html>

<head>
<title>WebGL testing</title>
<meta charset="UTF-8">
<script type="text/javascript" src="../../build/js/Cindy.js"></script>
<script type="text/javascript" src="../../build/js/Cindy3D.js"></script>
<script id="csinit" type="text/x-cindyscript">use("Cindy3D")</script>
<script id="csdraw" type="text/x-cindyscript">
begin3d();
background3d([0,0,0]);
size3d(2.4);
n=300;
r1=1;
r2=.3;
k=5;
l=3;
f(w):=(sin(l*w),cos(l*w),0)*(r1+r2*cos(k*w))+(0,0,r2*sin(k*w));
drawpoly3d(apply(1..n,i,f(i/n*360°)));
end3d()
</script>
<script type="text/javascript">
CindyJS({canvasname:"CSCanvas",scripts:"cs*"});
</script>
</head>

<body>
  <canvas id="Cindy3D" style="border: none;" width="632" height="452"></canvas>
  <div id="CSCanvas" style="width:50px; height:50px; border:none"></div>
</body>

</html>
